<?php
return array(
	'cascade' => array(
		'profile', 'activePrice',
	),
	'formView' => array(
		'fields' => array(
			'baseInfo' => array(
				'id' => false,
				'type_id' => false,
				'listing_time' => false,
				'short_title' => false,
				'status' => false,
				'object_type' => false,
				'class_id' => false,
				'listing_status' => false,
				'create_time' => false,
				'update_time' => false,
				'thumb' => array(
					'class'=>'FileField',
				),
				'is_recommend' => array('checkBox'),
				'provider_id' => array('dropDownList', Yii::app()->enum->options('worker.providerAndCategory'), 
					// 如果是供应商，则不可见
					'visible'=>'Yii::app()->adminUser->role != AdminUser::ROLE_PROVIDER',
				),
				'title' => false,
				'_with' => array(
					'cate.cate_id' => array(
						'class'=>'LinkageField', 
						'name'=>'pGoodsCate', 
						'fields'=>array('cate.cate_id'),
						'visible'=>'Yii::app()->adminUser->role == AdminUser::ROLE_PROVIDER',
					),
					'priceInfo.price_market',
					'priceInfo.price_dealer',
					'priceInfo.price_agent',
					'priceInfo.price_refer',				
				),
			),
			'profile' => array(
				'id' => false,
				'uid' => false,
				'goods_id' => false,
				'listing_time' => false,
				'airlines',
				'aircraft_type',
				'flight',
				'accommodation' => array('dropDownList', Yii::app()->enum->options(get_class($model) == 'Ticket' ? 'goods.flightAccommodation' : 'goods.trainAccommodation')),
				'departure_province' => array(
					'class' => 'LinkageField',
					// 地区选择
					'name' => 'district',
					// 那些字段要录入？
					'fields' => array(
						array('profile.departure_province' /* 字段 */, 1 /* 层级 */),
						array('profile.departure_city', 2),
					) 
				),
				'departure_city' => false,
				'arrival_province' => array(
					'class' => 'LinkageField',
					// 地区选择
					'name' => 'district',
					// 那些字段要录入？
					'fields' => array(
						array('profile.arrival_province' /* 字段 */, 1 /* 层级 */),
						array('profile.arrival_city', 2),
					) 
				),
				'arrival_city' => false,
				'departure_time' => array('class'=>'DatetimePickerField','params'=>array(
					'options' => array('dateFmt'=>'H:mm')
				)),
				'landing_time' => array('class'=>'DatetimePickerField','params'=>array(
					'options' => array('dateFmt'=>'H:mm')
				)),
				'eat' => array('dropDownList',array('无正餐'=>'无','有正餐'=>'有')),
				'explain' => array('class' => 'RichtextField', 'params'=>array('htmlOptions'=>array('style'=>'width:100%;height:200px'))),
				'num' => false,
			),
			'activePrice' => array(
				'id' => false,
				'name' => false,
				'goods_id' => false,
				'datetime' => array('class' => 'DatetimePickerField',
					'params' => array(
						'options' => array('dateFmt'=>'yyyy-MM-dd HH:mm:ss')
					),
				),
				'price_market' => array('textField', array('size'=>8)),
				'price_agent' => array('textField', array('size'=>8)),
				'price_dealer' => array('textField', array('size'=>8)),
				'price_refer' => array('textField', array('size'=>8))
			),
		)
	),
	
	'_import' => array(
		array('*', 'actions.edit//*'),
//		array('formView.fields.*','actions.goods.partials.activePrice//formView.fields.*'),
//		array('formView.fields.baseInfo.*', 'actions.goods.edit//formView.fields.baseInfo.*'),
	),
);